/*
 * 根据下面关系式，求圆周率的值，直到最后一项的值小于给定阈值。
​ * π/2 = 1 + 1/3 + 2!/(3*5) + 3!/(3*5*7) + ... + n!/(3*5*7*...*(2n+1))
*/
#include <stdio.h>
int main()
{
	double x;
	scanf("%lf", &x);

	double sum = 0.0;
	for (int i = 0; ; i++)
	{
		double s = 0.0;
		//计算n!
		double m = 1.0;
		for (int j = 1; j <= i; j++)
		{
			m *= j;
		}
		//计算3*5*7*...*(2n+1)
		double n = 1.0;
		for (int j = 1, k = 3; j <= i; j++, k += 2)
		{
			n *= k;
		}
		//计算n!/(3*5*7*...*(2n+1))
		s = m / n;
		sum += s;
		if (s < x)
		{
			break;
		}
	}

	printf("%.6lf\n", sum * 2);
	return 0;
}